/**
 * 
 */
package com.jeecms.wicool.manager.question.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.jeecms.common.hibernate3.Updater;
import com.jeecms.common.page.Pagination;
import com.jeecms.wicool.dao.question.QuestionDao;
import com.jeecms.wicool.entity.question.Question;
import com.jeecms.wicool.manager.question.QuestionMng;

/**
 * @author spring
 *
 */
public class QuestionMngImpl implements QuestionMng {

	@Autowired
	private QuestionDao questionDao;

	@Override
	public Pagination getPage(String title, Integer type, int pageNo,
			int pageSize) {
		return questionDao.getPage(title, type, pageNo, pageSize);
	}

	@Override
	public Question findById(Integer id) {
		return questionDao.findById(id);
	}

	@Override
	public Question save(Question bean) {
		return questionDao.save(bean);
	}

	@Override
	public Question deleteById(Integer id) {
		return questionDao.deleteById(id);
	}

	@Override
	public List<Question> deleteByIds(Integer[] ids) {
		return questionDao.deleteByIds(ids);
	}

	@Override
	public Question update(Question obj) {
		 Updater<Question> updater = new Updater<Question>(obj);
		 obj = questionDao.updateByUpdater(updater);
        return obj;
	}

	@Override
	public List<Question> getAll() {
		return questionDao.getAll();
	}
}
